﻿<% unless @articles.empty? %>
<table border="1">
  <tr>
    <th>文章名称</th>
    <th>文章作者</th>
    <th>所在科室</th>
    <th>收稿时间</th>
    <th>审稿次数</th>
    <th>投稿时间</th>
    <th>期刊名称</th>
    <th>期刊月号</th>
    <th>操作</th>
  </tr>
  <% for article in @articles %>
     <tr>
      <td>
        <%= article.articletitle-%></td>
    <td><%= article.author %></td>
    <td>
		<% @departments.each do |department| %>

	         <% if department.id == article.department_id %>
			    <%=  department.name%>
			 <% end %>
		<% end %>
	</td>
    <td><%= article.receiveddate -%></td>
    <td>
      <%= link_to_remote article.revision_records.length ,
                          :url =>{:action =>'get_revision_info', :article_id =>article.id},
                          :update => 'revision_info',
                    :before => "Element.show('revision_spinner');",
                    :complete  => "Element.hide('revision_spinner')" %>
      <%= image_tag '../images/spinner.gif', :id=> 'revision_spinner', :style=>"display:none;flot:right;" %>

    </td>
    <td><%= article.contributedate -%></td>
    <td><%= article.journal -%></td>
    <td><%= article.issuenumber -%></td>

    <td><%= link_to '修改', :action => 'edit', :id => article %>  
        <%= link_to '删除', { :action => 'destroy', :id => article }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
  <% end -%>
</table>
<%end -%>
